import React from 'react';

export interface IRoleAuthorizedContext {
  leftTreeData: any[];
  seachValueLeft: string;
  treeSelectKeys: string[];
  treeExpandedKeys: string[];
  roleAuthDispatch: React.Dispatch<any>;
  autoExpandParent: boolean;
  treeCheckRows: any[];
  seachValueRight: string;
  checkLengthData: number;
  currentIndex: number;
}

const INIT_ROLEAUTHORIZED_VALUE: IRoleAuthorizedContext = {
  leftTreeData: [],
  seachValueLeft: '',
  treeSelectKeys: [],
  treeExpandedKeys: [],
  roleAuthDispatch: () => {},
  autoExpandParent: false,
  treeCheckRows: [],
  seachValueRight: '',
  checkLengthData: 0,
  currentIndex: 0,
};

export const RoleAuthorizeContext = React.createContext<IRoleAuthorizedContext>(
  INIT_ROLEAUTHORIZED_VALUE,
);
